require "Common/define"
require "Logic/Config"
require "Common/functions"
require "Common/Class"

AudioManager = {}
AudioManager.HIT_SUFFIX = "_hit"
AudioManager.AMB_SUFFIX = "_amb"
AudioManager.LOOP_SUFFIX = "_lp"
AudioManager.WWISE_CURRENT_LANGUAGE = "wwise_current_language"
AudioManager.MUSIC_VOLUME_PLAYER_PREF = "wwise_music_volume"
AudioManager.SOUND_VOLUME_PLAYER_PREF = "wwise_sound_volume"
AudioManager.VOICE_VOLUME_PLAYER_PREF = "wwise_voice_volume"

AudioManager.CurrentLanguage = ""
AudioManager.CurrentLanguageSuffix = ""
AudioManager.MusicVolume = 0
AudioManager.SoundVolume = 0
AudioManager.VoiceVolume = 0

AudioManager.LastPlayMusicEvent = ""
AudioManager.LastPlayMusicGO = nil
AudioManager.LastPlayInteractionEventName = ""
AudioManager.LastPlayInteractionGO = nil
-- AudioManager.LastPlayAMBSoundEventName = ""
-- AudioManager.LastPlayAMBSoundGO = nil
AudioManager.LastPlayLoopSoundEventName = ""
AudioManager.IsHeroLevelUp = false
AudioManager.BGMDic = {}

function AudioManager.WwiseInit()
    --设置 是否显示 Wwise的报错信息
    WWISE.WwiseBehavior.IsShowWwiseErrorLog = Config.IS_SHOW_WWISE_Error
    --设置 语言包
    AudioManager.SetCurrentLanguage()
    
    --设置 音量
    AudioManager.initAudioVolume(AudioManager.WwiseFlagEnum.Music,AudioManager.MUSIC_VOLUME_PLAYER_PREF,40)
    AudioManager.initAudioVolume(AudioManager.WwiseFlagEnum.Sound,AudioManager.SOUND_VOLUME_PLAYER_PREF,41)
    AudioManager.initAudioVolume(AudioManager.WwiseFlagEnum.Voice,AudioManager.VOICE_VOLUME_PLAYER_PREF,42)
    local _audioType = AudioManager.WwiseFlagEnum.Music
    -- WWISE.WwiseBehavior.Play("Play_Mus_Start","", nil,_audioType) UIlogin 也会播 导致两次调用

    AudioManager.BGMDic ={}
    local _musicList = G.dataTable["t_sound_bgm"]
    for key, value in pairs(_musicList) do
        --if value.f_Id < 100 then
            AudioManager.BGMDic[value.f_LogicalNode] = value.f_Id
        --end
    end

    AudioManager.SetCityBGM()
end
function AudioManager.GetBGMInfo(panelName)
    local _bgmId = AudioManager.BGMDic[panelName]
    if _bgmId then
        return G.dataTable["t_sound_bgm"][tostring(_bgmId)]
    end
    return nil
end

-- 设置主城音乐
function AudioManager.SetCityBGM(mode)
    if not AudioManager.BGMDic then
        AudioManager.BGMDic = {}
    end
    local cityMode  = mode or tonumber(GetPlayerPrefs("city_mode") or 1)
    AudioManager.BGMDic["UICity"] = cityMode == 1 and 316 or 5
end

-- (WwiseFlagEnum wwiseFlag,string volumePlayerPref,int audioId)
function AudioManager.initAudioVolume(wwiseFlag,volumePlayerPref,audioId)
    local _newVolume = 0
    local _volumeValue = Util.GetPlayerPrefs(volumePlayerPref)
    if _volumeValue then
        _newVolume = toNumber(_volumeValue)
    else
        local _volumeConfig = G.dataTable["t_global"][tostring(audioId)]
        if _volumeConfig then
            _newVolume = _volumeConfig.f_int_value
        else
            _newVolume = 100
        end   
    end
    AudioManager.SetVolume(_newVolume,wwiseFlag)
end

-- (int newVolume,WwiseFlagEnum audioType)
function AudioManager.SetVolume(newVolume,audioType)
    if audioType == AudioManager.WwiseFlagEnum.Music then
        if newVolume ~= AudioManager.MusicVolume then
            AudioManager.MusicVolume = newVolume
            Util.SetPlayerPrefs(AudioManager.MUSIC_VOLUME_PLAYER_PREF,AudioManager.MusicVolume)
        end
        WWISE.WwiseBehavior.SetVolume(AudioManager.MusicVolume,AudioManager.WwiseFlagEnum.Music)
    elseif audioType == AudioManager.WwiseFlagEnum.Sound then
        if newVolume ~= AudioManager.SoundVolume then
            AudioManager.SoundVolume = newVolume
            Util.SetPlayerPrefs(AudioManager.SOUND_VOLUME_PLAYER_PREF,AudioManager.SoundVolume)
        end
        WWISE.WwiseBehavior.SetVolume(AudioManager.SoundVolume,AudioManager.WwiseFlagEnum.Sound)
    elseif audioType == AudioManager.WwiseFlagEnum.Voice then
        if newVolume ~= AudioManager.VoiceVolume then
            AudioManager.VoiceVolume = newVolume
            Util.SetPlayerPrefs(AudioManager.VOICE_VOLUME_PLAYER_PREF,AudioManager.VoiceVolume)
        end
        WWISE.WwiseBehavior.SetVolume(AudioManager.VoiceVolume,AudioManager.WwiseFlagEnum.Voice)
    else
        printError("Wwise: SetVolume is Error, audioType= ",audioType)
    end
end

-- f_Id 对应配置表 T_Sound_BattleSE、T_Sound_Bgm、T_Sound_Voice
--emitterGO 发声器，不需要发生器 填空
function AudioManager.Play(f_Id,emitterGO,callback)
    if string.IsNilOrEmpty(f_Id) then
        return
    end
    local _audioType = AudioManager.WwiseFlagEnum.Sound
    local _playEventName = ""
    --背景音乐
    local _audioInfo = G.dataTable["t_sound_bgm"][tostring(f_Id)]
    if _audioInfo then
        _audioType = AudioManager.WwiseFlagEnum.Music
        _playEventName = _audioInfo.f_Event

        --AudioManager.TryStopMusic()
        -- AudioManager.curPlayEvent = _audioInfo.f_Event
        AudioManager.LastPlayMusicEvent = _audioInfo.f_Event
        --AudioManager.LastPlayMusicGO = emitterGO
    else
        --音效
        _audioInfo = G.dataTable["t_sound_se_battle"][tostring(f_Id)]
        if _audioInfo then
            _audioType = AudioManager.WwiseFlagEnum.Sound
            _playEventName = _audioInfo.f_Event
        else
            _audioInfo = G.dataTable["t_sound_se_ui"][tostring(f_Id)]
            if _audioInfo then
                _audioType = AudioManager.WwiseFlagEnum.Sound
                _playEventName = _audioInfo.f_Event
                if string.match(_playEventName, AudioManager.AMB_SUFFIX)  then
                    return
                    --AudioManager.TryStopAMBSound()
                    --AudioManager.LastPlayAMBSoundEventName = _playEventName
                    --AudioManager.LastPlayAMBSoundGO = emitterGO
                elseif string.match(_playEventName, AudioManager.LOOP_SUFFIX) then
                    AudioManager.LastPlayLoopSoundEventName = _playEventName
                end
            else
                --语音
                _audioInfo = G.dataTable["t_sound_voice"][tostring(f_Id)]
                if _audioInfo then
                    _audioType = AudioManager.WwiseFlagEnum.Voice
                    _playEventName = _audioInfo.f_Event .. AudioManager.CurrentLanguageSuffix
                else
                    printError("Wwise: No Found this f_Id = ",f_Id)
                    return _playEventName
                end
            end
        end
    end
    --logError(_playEventName)
    WWISE.WwiseBehavior.Play(_playEventName,_audioInfo.f_Bnk, emitterGO,_audioType,callback)
    return _playEventName
end

function AudioManager.IsPlay(isPlay,wwiseFlag)
    if isPlay then
        if wwiseFlag == AudioManager.WwiseFlagEnum.Music then
            WWISE.WwiseBehavior.SetVolume(AudioManager.MusicVolume,AudioManager.WwiseFlagEnum.Music)
        elseif wwiseFlag == AudioManager.WwiseFlagEnum.Sound then
            WWISE.WwiseBehavior.SetVolume(AudioManager.SoundVolume,AudioManager.WwiseFlagEnum.Sound)
        elseif wwiseFlag == AudioManager.WwiseFlagEnum.Voice then
            WWISE.WwiseBehavior.SetVolume(AudioManager.VoiceVolume,AudioManager.WwiseFlagEnum.Voice)
        elseif wwiseFlag == AudioManager.WwiseFlagEnum.All then
            WWISE.WwiseBehavior.SetVolume(AudioManager.MusicVolume,AudioManager.WwiseFlagEnum.Music)
            WWISE.WwiseBehavior.SetVolume(AudioManager.SoundVolume,AudioManager.WwiseFlagEnum.Sound)
            WWISE.WwiseBehavior.SetVolume(AudioManager.VoiceVolume,AudioManager.WwiseFlagEnum.Voice)
        else
        end
    else
        if wwiseFlag == AudioManager.WwiseFlagEnum.Music then
            --不播放背景音，直接置0，不改变 MusicVolume 值
            WWISE.WwiseBehavior.SetVolume(0,AudioManager.WwiseFlagEnum.Music)
        elseif wwiseFlag == AudioManager.WwiseFlagEnum.Sound then
            --不播放音效，直接置0，不改变 SoundVolume 值
            WWISE.WwiseBehavior.SetVolume(0,AudioManager.WwiseFlagEnum.Sound)
        elseif wwiseFlag == AudioManager.WwiseFlagEnum.Voice then
            --不播放语音，直接置0，不改变 VoiceVolume 值
            WWISE.WwiseBehavior.SetVolume(0,AudioManager.WwiseFlagEnum.Voice)
        elseif wwiseFlag == AudioManager.WwiseFlagEnum.All then
            WWISE.WwiseBehavior.SetVolume(0,AudioManager.WwiseFlagEnum.Music)
            WWISE.WwiseBehavior.SetVolume(0,AudioManager.WwiseFlagEnum.Sound)
            WWISE.WwiseBehavior.SetVolume(0,AudioManager.WwiseFlagEnum.Voice)
        else
        end
    end
end

function AudioManager.SetSwitch(groupName,switchName,emitterGO)
    WWISE.WwiseBehavior.SetSwitch(groupName,switchName,emitterGO)
end
function AudioManager.SetState(stateGroup,stateValue)
    WWISE.WwiseBehavior.SetState(stateGroup,stateValue)
end

function AudioManager.SetRTPCValue(RTPCName,value)
    WWISE.WwiseBehavior.SetRTPCValue(RTPCName,value)
end

function AudioManager.PlayInteractionVoice(partnerModelId,skinId,interactionTag,partnerGO,luaFunction,isNotBreak)
    if  string.IsNilOrEmpty(partnerModelId) then
        return
    end
    local _interactionId = partnerModelId..tostring(skinId) .. interactionTag
    local _interactionInfo = G.dataTable["t_interaction"][tostring(_interactionId)]
    if _interactionInfo then
        if not string.IsNilOrEmpty(_interactionInfo.f_Rtpc) then
            local _rtpcArr = _interactionInfo.f_Rtpc
            AudioManager.SetRTPCValue(_rtpcArr[1],toNumber(_rtpcArr[2]))
        end
        local _audioInfo = G.dataTable["t_sound_voice"][tostring(_interactionInfo.f_Voice)]
        if _audioInfo then
            local _audioType = AudioManager.WwiseFlagEnum.Voice
            local _eventName = _audioInfo.f_Event .. AudioManager.CurrentLanguageSuffix
            if isNotBreak == true then
                
            else
                AudioManager.TryStopInteractionVoice()
                AudioManager.LastPlayInteractionEventName = _eventName
                AudioManager.LastPlayInteractionGO = partnerGO
            end
            WWISE.WwiseBehavior.Play(_eventName,_audioInfo.f_Bnk, partnerGO,_audioType,luaFunction)
            
        end
    end
end

function AudioManager.SetCurrentLanguage(newLanguageName)
    if string.IsNilOrEmpty(newLanguageName) then
        AudioManager.CurrentLanguage = Util.GetPlayerPrefs(AudioManager.WWISE_CURRENT_LANGUAGE)
        if string.IsNilOrEmpty(AudioManager.CurrentLanguage) then
            local _tagIndex = 1
            local _tagConfig = G.dataTable["t_global"][tostring(192)]
            if _tagConfig  then
                _tagIndex = _tagConfig.f_int_value
            end
            AudioManager.CurrentLanguage = AudioManager.VoiceLanguageTable[_tagIndex].Tag
            Util.SetPlayerPrefs(AudioManager.WWISE_CURRENT_LANGUAGE,AudioManager.CurrentLanguage)
        end
    else
        if AudioManager.CurrentLanguage ~= newLanguageName then
            AudioManager.CurrentLanguage = newLanguageName
            Util.SetPlayerPrefs(AudioManager.WWISE_CURRENT_LANGUAGE,AudioManager.CurrentLanguage)
        end
    end

    for _, value in ipairs(AudioManager.VoiceLanguageTable) do
        if value.Tag == AudioManager.CurrentLanguage then
            AudioManager.CurrentLanguageSuffix = value.Suffix
            break
        end
    end
    
    --WWISE.WwiseBehavior.SetCurrentLanguage(AudioManager.CurrentLanguage)
end

function AudioManager.Stop(playEventName,emitterGO,audioType)
    if  string.IsNilOrEmpty(playEventName) then
        return
    end

    if string.IsNilOrEmpty(audioType) then
        audioType = AudioManager.WwiseFlagEnum.Sound
    end
    local _stopEvent = string.gsub(playEventName,"Play","Stop",1)
    WWISE.WwiseBehavior.Play(_stopEvent,"", emitterGO,audioType,nil)
end

function AudioManager.TryStopMusic()
    -- if not string.IsNilOrEmpty(AudioManager.LastPlayMusicEvent) then
    --     local _audioType = AudioManager.WwiseFlagEnum.Music
    --     AudioManager.Stop(AudioManager.LastPlayMusicEvent,AudioManager.LastPlayMusicGO,_audioType)

    --     AudioManager.LastPlayMusicEvent = nil
    --     AudioManager.LastPlayMusicGO = nil
    -- end
end
function AudioManager.TryStopInteractionVoice()
    if not string.IsNilOrEmpty(AudioManager.LastPlayInteractionEventName) then
        local _audioType = AudioManager.WwiseFlagEnum.Voice
        AudioManager.Stop(AudioManager.LastPlayInteractionEventName,AudioManager.LastPlayInteractionGO,_audioType)

        AudioManager.LastPlayInteractionEventName = nil
        AudioManager.LastPlayInteractionGO = nil
    end
end
function AudioManager.TryStopAMBSound()
    -- if not string.IsNilOrEmpty(AudioManager.LastPlayAMBSoundEventName) then
    --     local _audioType = AudioManager.WwiseFlagEnum.Sound
    --     AudioManager.Stop(AudioManager.LastPlayAMBSoundEventName,AudioManager.LastPlayAMBSoundGO,_audioType)

    --     AudioManager.LastPlayAMBSoundEventName = nil
    --     AudioManager.LastPlayAMBSoundGO = nil
    -- end
end
--关闭loop音效
function AudioManager.TryStopLoopSound()
    if not string.IsNilOrEmpty(AudioManager.LastPlayLoopSoundEventName) then
        local _audioType = AudioManager.WwiseFlagEnum.Sound
        AudioManager.Stop(AudioManager.LastPlayLoopSoundEventName,nil,_audioType)
        AudioManager.LastPlayLoopSoundEventName = nil
    end
end

--播放/关闭 任务奖励的飞行动画音效
function AudioManager.TryPlayFlySound(itemModelId,isPlay)
    local _soundId = -1
    if isPlay then
        if itemModelId == CurrencyEnum.GOLD then
            _soundId = 1034
        elseif itemModelId == CurrencyEnum.MONEY then
            _soundId = 1036
        elseif itemModelId == CurrencyEnum.Dailyliveness or itemModelId == CurrencyEnum.Weekliveness then
            _soundId = 1040
        else
            _soundId = 1038
        end
    else
        if itemModelId == CurrencyEnum.GOLD then
            _soundId = 1035
        elseif itemModelId == CurrencyEnum.MONEY then
            _soundId = 1037
        elseif itemModelId == CurrencyEnum.Dailyliveness or itemModelId == CurrencyEnum.Weekliveness then
            _soundId = 1041
        else
            _soundId = 1039
        end
    end
    if _soundId > -1 then
        AudioManager.Play(_soundId)
    end
end

--播放道具变化的音效
function AudioManager.TryPlaySoundItemChange(itemModelId,isAdd)
    --英雄升级不播放金币消耗
    if AudioManager.IsHeroLevelUp and itemModelId == CurrencyEnum.MONEY then
        --AudioManager.IsHeroLevelUp = false
        return
    end

    if isAdd then
        
    else
        if itemModelId == CurrencyEnum.GOLD then
            AudioManager.Play(2004);--获得和消耗红魔石提示音效
        elseif itemModelId == CurrencyEnum.MONEY then
            AudioManager.Play(2003);--获得和消耗游戏币提示音效
        elseif itemModelId == CurrencyEnum.SailBook then
            AudioManager.Play(2005);--消耗起航之证提示音效
        elseif itemModelId == CurrencyEnum.EmploymentLetter then
            AudioManager.Play(2006);--消耗英雄招募函提示音效
        elseif itemModelId == CurrencyEnum.HeroLetter then
            AudioManager.Play(2002);--消耗职业招募函提示音效
        elseif itemModelId == CurrencyEnum.Crystallography then
            AudioManager.Play(2008);--消耗秘境结晶提示音效
        elseif itemModelId == CurrencyEnum.HopeBall then
            AudioManager.Play(2009);--消耗许愿水晶提示音效
        elseif itemModelId == 200046 then
            AudioManager.Play(2007);--消耗相逢之证提示音效
        end
    end
    
end

--播放装备/卸载音效
function AudioManager.TryPlaySoundByWear(heroType,isWear)
    --装备
    if isWear then
        if heroType == 1 or heroType == 4 then
            --骑士/战士 板甲
            AudioManager.Play(1021)
        elseif heroType == 2 or heroType == 6 then
            --游侠/刺客 皮甲
            AudioManager.Play(1019)
        elseif heroType == 3 or heroType == 5  then
            --魔导师/牧师 布甲
            AudioManager.Play(1017)
        end
    else    --卸载
        if heroType == 1 or heroType == 4 then
            --骑士/战士 板甲
            AudioManager.Play(1022)
        elseif heroType == 2 or heroType == 6 then
            --游侠/刺客 皮甲
            AudioManager.Play(1020)
        elseif heroType == 3 or heroType == 5  then
            --魔导师/牧师 布甲
            AudioManager.Play(1018)
        end
    end
end

function AudioManager.RefreshBGM()
    LuaHelper.GetPanelManager():CheckApexPanel()
end

--播放BGM
function AudioManager.PlayBGM(showPanels)
    --logError("refresh audio -----------------------")
    -- local showPanelList = string_split(showPanels,",")
    -- local _bgmInfo
    -- for key, value in pairs(showPanelList) do
    --     if not string.IsNilOrEmpty(value) then
    --         _bgmInfo = AudioManager.GetBGMInfo(value)
    --         if _bgmInfo and not string.IsNilOrEmpty(_bgmInfo.f_Event) then
    --             if AudioManager.LastPlayMusicEvent ~= _bgmInfo.f_Event then
    --                 AudioManager.LastPlayMusicEvent = _bgmInfo.f_Event
    --                 local _audioType = AudioManager.WwiseFlagEnum.Music
    --                 WWISE.WwiseBehavior.Play(_bgmInfo.f_Event, "",nil,_audioType)
    --             end
    --             return
    --         end
    --     end
    -- end
end
local bgm_cache = {}
function AudioManager.PlayBGMOnOpenUI(uiname)
    local bgm_info = AudioManager.GetBGMInfo(uiname)
    if bgm_info and not string.IsNilOrEmpty(bgm_info.f_Event) then
        if AudioManager.curPlayEvent ~= bgm_info.f_Event then
            AudioManager.curPlayEvent = bgm_info.f_Event
            WWISE.WwiseBehavior.Play(bgm_info.f_Event, "", nil, AudioManager.WwiseFlagEnum.Music)
            for i=table.getn(bgm_cache), 1, -1 do
                if bgm_cache[i].f_Id == bgm_info.f_Id then
                    table.remove(bgm_cache, i)
                    break
                end
            end
            table.insert(bgm_cache, bgm_info)
        end
    end
end

function AudioManager.PlayBGMOnCloseUI(uiname, isDestroy)
    local bgm_info = AudioManager.GetBGMInfo(uiname)
    if bgm_info and not string.IsNilOrEmpty(bgm_info.f_Event) then
        local count = table.getn(bgm_cache)
        for i=count, 1, -1 do
            if bgm_cache[i].f_Id == bgm_info.f_Id then
                table.remove(bgm_cache, i)
                break
            end
        end
        count = table.getn(bgm_cache)
        if bgm_cache[count] then
            if AudioManager.curPlayEvent ~= bgm_cache[count].f_Event then
                AudioManager.Stop(AudioManager.curPlayEvent, nil, AudioManager.WwiseFlagEnum.Music)
                
                WWISE.WwiseBehavior.Play(bgm_cache[count].f_Event, "", nil, AudioManager.WwiseFlagEnum.Music)
                -- logError("关闭界面切换panel:" .. uiname .. "_".. bgm_cache[count].f_Event)
                AudioManager.curPlayEvent = bgm_cache[count].f_Event
            end
        end
    end
end

function AudioManager.PlayByEventName(eventName,emitterGO,audioType)
    WWISE.WwiseBehavior.Play(eventName, "",emitterGO,audioType)
end

function AudioManager.GetLanguageBank()
    local _soundBankName = ""
    for _, value in ipairs(AudioManager.VoiceLanguageTable) do
        if value.Tag == AudioManager.CurrentLanguage then
            _soundBankName = value.SoundBank
        else
            WWISE.WwiseBehavior.UnloadBank(value.SoundBank)
        end
    end
    return _soundBankName
end
--异步加载SoundBank
function AudioManager.LoadBankAsync(bankName,luaCallback)
    WWISE.WwiseBehavior.LoadBankAsync(bankName,luaCallback)
end


AudioManager.WwiseFlagEnum =
{
    All = 0,
    Music = 1,
    Sound = 2,
    Voice = 3,
}

-- Note 并不是用，Name对应语言项
AudioManager.InteractionTagTable =
{
    {Index = 1,Tag = "01",Name="InteractionVoiceDrawCard",Note="抽卡"},
    {Index = 2,Tag = "02",Name="InteractionVoicePersonalSetting",Note="进入个人设置"},
    {Index = 3,Tag = "03",Name="InteractionVoicePersonalSetting2",Note="进入个人设置2"},
    {Index = 4,Tag = "04",Name="InteractionVoiceBirthdaySetting",Note="进入个人设置（生日)"},
    {Index = 5,Tag = "05",Name="InteractionVoiceBirthdaySetting2",Note="进入个人设置（生日2)"},
    {Index = 6,Tag = "06",Name="InteractionVoiceClickHero1",Note="英雄界面点击角色1"},
    {Index = 7,Tag = "07",Name="InteractionVoiceClickHero2",Note="英雄界面点击角色2"},
    {Index = 8,Tag = "08",Name="InteractionVoiceClickHero3",Note="英雄界面点击角色3"},
    {Index = 9,Tag = "09",Name="InteractionVoiceClickHero4",Note="英雄界面点击角色4"},
    {Index = 10,Tag = "10",Name="InteractionVoiceLevelUp",Note="升级"},
    {Index = 11,Tag = "11",Name="InteractionVoiceSwitchingEquipment",Note="更换装备"},
    {Index = 12,Tag = "12",Name="InteractionVoiceSkill1",Note="查看必杀技"},
    {Index = 13,Tag = "13",Name="InteractionVoiceSkill2",Note="查看技能1"},
    {Index = 14,Tag = "14",Name="InteractionVoiceSkill3",Note="查看技能2"},
    {Index = 15,Tag = "15",Name="InteractionVoiceSkill4",Note="查看技能3"},
    {Index = 16,Tag = "16",Name="InteractionVoiceGoIntoBattle",Note="上阵"},
    {Index = 17,Tag = "17",Name="InteractionVoiceBattleStart",Note="战斗开始"},
    {Index = 18,Tag = "18",Name="InteractionVoiceBattleWin1",Note="战斗胜利1"},
    {Index = 19,Tag = "19",Name="InteractionVoiceBattleWin2",Note="战斗胜利2"},
    {Index = 20,Tag = "20",Name="InteractionVoiceDieInBattle1",Note="死亡1"},
    {Index = 21,Tag = "21",Name="InteractionVoiceDieInBattle2",Note="死亡2"},
    {Index = 22,Tag = "22",Name="InteractionVoiceClickHeroInCity1",Note="主城点击小人1"},
    {Index = 23,Tag = "23",Name="InteractionVoiceClickHeroInCity2",Note="主城点击小人2"},
    {Index = 24,Tag = "24",Name="InteractionVoiceClickHeroInCity3",Note="主城点击小人3"},
    {Index = 25,Tag = "25",Name="InteractionVoiceClickHeroInCity4",Note="主城点击小人4"},
    {Index = 26,Tag = "26",Name="InteractionVoiceDragHeroInCity1",Note="主城拎起小人1"},
    {Index = 27,Tag = "27",Name="InteractionVoiceDragHeroInCity2",Note="主城拎起小人2"},
    {Index = 28,Tag = "28",Name="InteractionVoiceDragHeroInCity3",Note="主城拎起小人3"},
    {Index = 29,Tag = "29",Name="InteractionVoiceDragHeroInCity4",Note="主城拎起小人4"},
}

-- Note 并不是用，Name对应语言项
AudioManager.VoiceLanguageTable =
{
    {Suffix = "",Tag = "Japanese(JP)",Name="VoiceLanguageJapanese",SoundBank="vo_jap"},
    {Suffix = "_ch",Tag = "Chinese(CN)",Name="VoiceLanguageChinese",SoundBank="vo_ch"},
    --{Suffix = "_en",Tag = "English(US)",Name="VoiceLanguageEnglish"},
}

--视频
AudioManager.VideoInfo =
{
    {Name = "CGA",Path="Video/MediaPlayer_CGA",Time=65000},
    {Name = "CG_FirstFight",Path="Video/Video_PlayerFirstFight",Time=42000},
}


AudioManager.Play_Fetter_active = 2011      --英雄羁绊
AudioManager.Play_ani_card_R = 4008
AudioManager.Play_ani_card_SR = 4009
AudioManager.Play_ani_card_SSR = 4010
AudioManager.ani_compass_swing = 4011       --关卡轮盘旋转音效

AudioManager.Play_UI_Start_Fight = 3002
AudioManager.Play_UI_New_Hero = 1042
AudioManager.Play_UI_ADV_Award_Get = 1043
AudioManager.Play_UI_Hero_File_Page = 1044
AudioManager.Play_UI_Award_Box_Drop = 1045
AudioManager.Play_UI_Award_Box_Open = 1046
AudioManager.Play_UI_Buy = 1047
AudioManager.Play_New_Chapter = 1048

return AudioManager